package cn.bugstack.domain.strategy.model.entity;

import cn.bugstack.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * @Title: RuleActionEntity
 * @Author lz
 * @Date 2025/7/30 20:16
 * @description: 规则动作实体（规则过滤之后返回的实体对象）
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {
    private String code= RuleLogicCheckTypeVO.ALLOW.getCode();//初始默认值，默认放行，后续可在过滤器中更改
    private String info= RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;

    static public class RaffleEntity{

    }
    //抽奖之前
    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleBeforeEntity extends RaffleEntity{
        /**
         * 策略ID
         */
        private Long strategyId;
        /**
         * 权重值key，用于抽奖时选择权重抽奖
         */
        private String ruleWeightKey;
        /**
         * 奖品ID
         */
        private Integer awardId;
    }
    //抽奖中
    static public class RaffleCenterEntity extends RaffleEntity{

    }
    //抽奖之后
    static public class RaffleAfterEntity extends RaffleEntity{

    }

}
